home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / misc / defs / defs.h next >
C/C++ Source or Header  |  1992-04-13  |  2KB  |  70 lines

  1. //
  2. //
  3. // Copyright (C) 1991 Texas Instruments Incorporated.
  4. //
  5. // Permission is granted to any individual or institution to use, copy, modify,
  6. // and distribute this software, provided that this complete copyright and
  7. // permission notice is maintained, intact, in all copies and supporting
  8. // documentation.
  9. //
  10. // Texas Instruments Incorporated provides this software "as is" without
  11. // express or implied warranty.
  12. //
  13. // This file contains common definitions, macros, and constants used by header
  14. // and source files under ICE.
  15. //
  16.  
  17. #ifndef DEFSH                    // If no defs header file
  18. #define DEFSH
  19.  
  20. #ifndef BOOLEANH                // If Boolean type not defined
  21. #define BOOLEANH
  22. typedef int Boolean;                // Define Boolean data type
  23. #endif
  24.  
  25. #undef TRUE                    // ensure TRUE is defined
  26. #define TRUE (1)
  27.  
  28. #undef FALSE                    // ensure FALSE is defined
  29. #define FALSE (0)
  30.  
  31. #undef NULL                    // ensure NULL is defined
  32. #define NULL 0
  33.  
  34. #ifndef __cplusplus
  35. overload min;
  36. overload max;
  37. #endif
  38.  
  39. #if defined(DOS)
  40. extern "C" {
  41. #include <stdlib.h>        // include the standard c library
  42. }
  43. #else
  44.  
  45. #ifdef IV_INSTALLED            // Interviews define these already
  46. #include <InterViews/defs.h>
  47. #else
  48. // min --  Return the minimum of two long integers
  49. // Input:  Two long integers
  50. // Output: Smallest of two longs
  51.  
  52. inline char min (char a, char b) {return (a < b) ? a : b;}
  53. inline int min (int a, int b) {return (a < b) ? a : b;}
  54. inline long min (long a, long b) {return (a < b) ? a : b;}
  55. inline double min (double a, double b) {return (a < b) ? a : b;}
  56.  
  57. // max --  Return the maximum of two long integers
  58. // Input:  Two long integers
  59. // Output: Largest of two longs
  60.  
  61. inline char max(char a, char b) {return (a > b) ? a : b;}
  62. inline int max(int a, int b) {return (a > b) ? a : b;}
  63. inline long max(long a, long b) {return (a > b) ? a : b;}
  64. inline double max(double a, double b) {return (a > b) ? a : b;}
  65. #endif
  66.  
  67. #endif
  68.  
  69. #endif DEFSH                // End #ifdef
  70.